/**
 * The Selling Partner API for Sellers
 * The [Selling Partner API for Sellers](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) (Sellers API) provides essential information about seller accounts, such as:  - The marketplaces a seller can list in - The default language and currency of a marketplace - Whether the seller has suspended listings  Refer to the [Sellers API reference](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) for details about this API's operations, data types, and schemas.
 *
 * The version of the OpenAPI document: v1
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 *
 */

import { ApiClient } from '../ApiClient.js'
import { Business } from './Business.js'
import { MarketplaceParticipation } from './MarketplaceParticipation.js'
import { PrimaryContact } from './PrimaryContact.js'

/**
 * The Account model module.
 * @module sellers_v1/model/Account
 * @version v1
 */
export class Account {
  /**
   * Constructs a new <code>Account</code>.
   * The response schema for the &#x60;getAccount&#x60; operation.
   * @alias module:sellers_v1/model/Account
   * @class
   * @param marketplaceParticipationList {[MarketplaceParticipation]} List of marketplace participations.
   * @param businessType {String} The type of business registered for the seller account.
   * @param sellingPlan {String} The selling plan details.
   */
  constructor (marketplaceParticipationList, businessType, sellingPlan) {
    this.marketplaceParticipationList = marketplaceParticipationList
    this.businessType = businessType
    this.sellingPlan = sellingPlan
  }

  /**
   * Constructs a <code>Account</code> from a plain JavaScript object, optionally creating a new instance.
   * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
   * @param {Object} data The plain JavaScript object bearing properties of interest.
   * @param {Account} obj Optional instance to populate.
   * @return {Account} The populated <code>Account</code> instance.
   */
  static constructFromObject (data, obj) {
    if (data) {
      switch (typeof data) {
        case 'string':
          obj = String(data)
          break
        case 'number':
          obj = Number(data)
          break
        case 'boolean':
          obj = Boolean(data)
          break
      }
      obj = obj || new Account()
      if (data.hasOwnProperty('marketplaceParticipationList')) { obj.marketplaceParticipationList = ApiClient.convertToType(data.marketplaceParticipationList, [MarketplaceParticipation]) }
      if (data.hasOwnProperty('businessType')) { obj.businessType = ApiClient.convertToType(data.businessType, 'String') }
      if (data.hasOwnProperty('sellingPlan')) { obj.sellingPlan = ApiClient.convertToType(data.sellingPlan, 'String') }
      if (data.hasOwnProperty('business')) { obj.business = Business.constructFromObject(data.business) }
      if (data.hasOwnProperty('primaryContact')) { obj.primaryContact = PrimaryContact.constructFromObject(data.primaryContact) }
    }
    return obj
  }
}

/**
 * List of marketplace participations.
 * @member {[MarketplaceParticipation]} marketplaceParticipationList
 * @type {[MarketplaceParticipation]}
 */
Account.prototype.marketplaceParticipationList = undefined

/**
 * Allowed values for the <code>businessType</code> property.
 * @enum {String}
 * @readonly
 */
Account.BusinessTypeEnum = {

  /**
     * value: "CHARITY"
     * @const
     */
  CHARITY: 'CHARITY',

  /**
     * value: "CRAFTSMAN"
     * @const
     */
  CRAFTSMAN: 'CRAFTSMAN',

  /**
     * value: "NATURAL_PERSON_COMPANY"
     * @const
     */
  NATURAL_PERSON_COMPANY: 'NATURAL_PERSON_COMPANY',

  /**
     * value: "PUBLIC_LISTED"
     * @const
     */
  PUBLIC_LISTED: 'PUBLIC_LISTED',

  /**
     * value: "PRIVATE_LIMITED"
     * @const
     */
  PRIVATE_LIMITED: 'PRIVATE_LIMITED',

  /**
     * value: "SOLE_PROPRIETORSHIP"
     * @const
     */
  SOLE_PROPRIETORSHIP: 'SOLE_PROPRIETORSHIP',

  /**
     * value: "STATE_OWNED"
     * @const
     */
  STATE_OWNED: 'STATE_OWNED',

  /**
     * value: "INDIVIDUAL"
     * @const
     */
  INDIVIDUAL: 'INDIVIDUAL'
}

/**
 * The type of business registered for the seller account.
 * @member {String} businessType
 * @type {String}
 */
Account.prototype.businessType = undefined

/**
 * Allowed values for the <code>sellingPlan</code> property.
 * @enum {String}
 * @readonly
 */
Account.SellingPlanEnum = {

  /**
     * value: "PROFESSIONAL"
     * @const
     */
  PROFESSIONAL: 'PROFESSIONAL',

  /**
     * value: "INDIVIDUAL"
     * @const
     */
  INDIVIDUAL: 'INDIVIDUAL'
}

/**
 * The selling plan details.
 * @member {String} sellingPlan
 * @type {String}
 */
Account.prototype.sellingPlan = undefined

/**
 * @member {Business} business
 * @type {Business}
 */
Account.prototype.business = undefined

/**
 * @member {PrimaryContact} primaryContact
 * @type {PrimaryContact}
 */
Account.prototype.primaryContact = undefined
